import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dell
 * Date: 2023-12-18
 * Time: 12:12
 */
public class test2 {
    //求222222
    public static int adds(int n){
        if (n==1){
            return 2;
        }else {
            return adds((n-1))+2*(int)Math.pow(10,n-1);
        }
    }
    public static int add(int n){
        int num=n;
        if (n==1){
            return 2;
        }else {
            int sum=0;
            while(n>0){
                sum=2+sum*10;
                n--;
            }
            return add(num-1)+sum;
        }
    }
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        int Sn=add(a);
        System.out.println(Sn);
        System.out.println(adds(5));
    }
}